package com.open.capacity.course.controller;

import com.open.capacity.common.model.CourseUser;
import com.open.capacity.common.web.PageResult;
import com.open.capacity.common.web.Result;
import com.open.capacity.course.service.CourseUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/courseUser")
@Api(tags = "课程审核管理")
public class CourseUserController {

    @Autowired
    private CourseUserService courseUserService;

    // 模糊查询课程
    @PostMapping("/getSelectCourseUsers")
    @ApiOperation(value = "模糊查询课程号")
    public PageResult<CourseUser> getSelectCourseUsers(@RequestParam Map<String, Object> params){
        return courseUserService.getSelectCourseUsers(params);
    }

    @PostMapping("/choice")
    @ApiOperation(value = "课程选择")
    public Result choice(@RequestBody CourseUser courseUser){
        return courseUserService.choice(courseUser);
    }

    @PostMapping("/update")
    @ApiOperation(value = "课程审核状态修改")
    public Result update(@RequestBody CourseUser courseUser){
        return courseUserService.update(courseUser);
    }

}
